package com.kunlong.util;

import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 预约计费服务
 * @name ParkingBillService
 * @author zz  | www.xwparking.com
 * @date 2018年11月2日  
 * @description:
 */
public interface ComputeService {

	/**
	 * 计费
	 * @param parkNum
	 * @param sn
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public BillResult bill(BillParam param);
	public ComputeResult compute(PayParam param);

	@Data
	public static class SubParam {
		int id;
		int delay;
	}
		@Data
	public static class PayParam {
		private Long empId;
			//人工单价
			private BigDecimal price;
			private BigDecimal workDays;
			private BigDecimal overtimeDays;
			private BigDecimal holidayOtDays;

			List<Integer> lst = new ArrayList<>();
			List<SubParam> subParams = new ArrayList<>();

		}

	public static class BillParam {
		private Date startTime;
		private Date endTime;
		private Integer parkId;

		public BillParam() {
		}
		public BillParam(Date startTime, Date endTime, Integer parkId) {
			this.startTime = startTime;
			this.endTime = endTime;
			this.parkId = parkId;
		}
		public Date getStartTime() {
			return startTime;
		}
		public void setStartTime(Date startTime) {
			this.startTime = startTime;
		}
		public Date getEndTime() {
			return endTime;
		}
		public void setEndTime(Date endTime) {
			this.endTime = endTime;
		}
		public Integer getParkId() {
			return parkId;
		}
		public void setParkId(Integer parkId) {
			this.parkId = parkId;
		}
		
	}
	@Data
	public static class ComputeResult {
		//员工标识
		private int timesIgnore;
		//费用
		private int totalMinutes;
		private String remark;

	}
	@Data
	public static class PayResult {
		//员工标识
		private Long empId;
		//费用
		private BigDecimal amount;
		private String remark;

	}
	public static class BillResult {
		/**
		 * 实际费用
		 */
		private BigDecimal amount;
		private String remark;

		public BigDecimal getAmount() {
			return amount;
		}

		public void setAmount(BigDecimal amount) {
			this.amount = amount;
		}

		public String getRemark() {
			return remark;
		}

		public void setRemark(String remark) {
			this.remark = remark;
		}
		
	}
}
